package com.infore.exchange.main.emums;

import com.alibaba.druid.pool.DruidDataSource;
import com.zaxxer.hikari.HikariDataSource;
import lombok.Getter;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.sql.DataSource;

public enum DataSourceType {
    /**
     * Druid
     */
    DRUID("Druid", DruidDataSource.class),
    /**
     * Hikari
     */
    HIKARI("Hikari", HikariDataSource.class),
    /**
     * Driver
     */
    DRIVER("Driver", DriverManagerDataSource.class);


    /**
     * 连接池类型
     */
    @Getter
    private  String       type;
    /**
     * 实现类
     */
    @Getter
    private  Class<? extends DataSource>  implClass;

    DataSourceType(String type, Class<? extends DataSource> implClass) {
        this.type = type;
        this.implClass = implClass;
    }
}
